Module refactoring wip