Process manager tidy up and refactoring