optimized the main GUI