move query processor to use strategy design pattern