Modularize Query Service