refactored controller generation to be a module that requires certain class methods rather than a function that dynamically defines methods