refactored process handling more like a userland sapi