Refactor the query stuff
0.6.0