Refactored and cleanup some code related to JsonPath extraction