types refactoring