type refactoring