documentation, tests, general improvements