adding unit tests and refactoring model#all_monitors code