Moving query cirterias into its own class
Merge branch 'SelectiveSendRefactoring'