style cleanup, docstrings etc