more code cleanup, specifically with tests.