move inner classes of QueryController