Ideas for making this more declarative: - use a macro that takes name, index, and type, and generates all appropriate methods. Should feed into ModuleFactory in a clean way (may need to refactor the module construction logic).