Improve and document Type and its factory.