Clean up main() method.