simplify some wheres