Docstrings and cleanup