Remove redundant methods and improve docstrings.
Clean up implementation.
Add unit tests.