process monitoring refactored