refactor - use abstract query for better reusabilities