Break up main() into multiple smaller methods.