Moving single fun into where clause