Refactoring, Added ability to exit from main menu