refactoring mainview part 1