Better process spawning logic.