Minor improvement code style buildQuery()