Moved auto suggest logic to a class