Add documentation and nullable annotations.