cleaned up entity spawning code