refactor monitor-rule model