handle Poco::Process exceptions plus refactoring