Refactoring core type definition code.