refactor out the task handled by the monitor