Refactor view controllers