all tests are passing. time to refactor and clean up.