streamlined and generalised the spawner to speed it up and allow further extension