More legacy code removed, few functions renamed, docstrings updated