Cleaning up main class and organizing things better.