Clean up the run method by putting the "set up" things inside an init function.
Clean up the run method by putting the "set up" things inside an init function.