Add type factory.
Fix indention of comments.