Revised helpers. Added docstrings.