re-structured QueryHandler & Ranker