better docstrings, some simplification