Modularized the two tests and corrected QueryUtlity