refactor controller code into models