Improved documentation and type hints.