some cleanup and more tests