refactor code to get rid of QueryPosting objects
implement IN queries