Externalize the json conversion of projection, query and sort