added UT for monitoring module and refactored monitoring module