refactored appmonitor into module