Separated testing functionallity into Query class.