refactor to use module.controller to define controller