review code, move query to the new predicates