Spawn timer
Refactored spawn_engine.js