moving controller methods to a module