Refactoring monitor and adding an example