this is the only change. the rest is cleanup and tests.