fixes
some refactoring on the spawning stuff