Cleanup of main

This makes moving forward much simpler.