clean up + some docstrings