Clean up the main method.