Refactoring of jsonPath.js