beginnings of a better query builder