moved suggest query code to static method and updated corresponding uses