Refactoring QueryBuiler class and specs