Minor refacotring

Refactored getting the parameter name only once.
Used the containsAll method to reduce the number of paths to test.
Added mock tests to improve coverage to 100%