I cleaned up the main class a bit