Refactor tests and documentation.