* API improvements, code clean-up, docstrings