improve tests, some cleanups