removed duplicated code
added a queryDTO object to compare by specific string hash.