refactoring: getType