Move business logic out of view