refactoring. main activity changed