Duplication in sending a query removed to helper method