refactoring: generalize makeTypes, nameTypes