refactoring view controllers