Refactor type implementation.