process monitor refactored, first tries