mainscreen refactoring