Refactored monitor class.