Refactoring the main screen