docstrings and refractoring