Refactor view controller structure