Add tests.
Extract methods to Types.