Refactoring code on service_dependency_mapping.py plugin.