start of genericising of Query