spawn module refactoring