Refactoring into viewcontrollers