cleaned up main class