initial query builder