Improve docblocks and type hints