docs and test refactoring