MULE-7502: Refactored code according to PR comments. Added services tests.