refactoring an service-check module