Port all existing queries into the code base