Refine docstrings and comments