type-printer refactoring