add utility to make type objects and tiny refactorings