Refactor and finalize code on service_dependency_mapping.py plugin.