cleanup and tests.