refactored the maximize window on startup routine