refactored to use hash in representation instead of inheriting hash dire...

...ctly