spawner module refactoring