Refactored code and cleaned up confusing syntax.

* Refactored helper methods as private methods.
* Removed extraneous documentation.