Clean up code, improve tests.
Increase test coverage, use OutputType where relevant.