clean up tests and merge a bit