Cleanup + unit testing.