Improve docstrings and typespecs (#15547)