Refatoring QueryBuilder specs