Refactored Type class.