Refactor monitoring tasks