improve tests and documentation