New util class and minor code refactoring in the viewtype wizard