seperate the parsing of query from the main function and make import dynamic