refactor controller to use one module