Refactoring of QueryParts