Remove unused imports; add missing docstrings