Cleanup of main class