refactoring of query builder - addition of comments