restructured spawner code