cleanup and make tests pass