Moved checks into construct query