Move the main processing loop out of the constructor and into its own method.