Fixed a bug and renamed helper methods.

Fix a bug where the value was being used as a key.
Prefixed helper methods to prevent future collisions.