move code of ProcessManager to main App