refactor StoreService and QueryService