Refactoring out more view logic