Refacto of spawning mechanism