cleanup
More tests, improvements