Generalized the particle spawner