refactor monitoring