Merge iter into query, make it more simply