Breakout Query function into its own class