INWORK: refactoring of process manager, add unit test