Refactored to inject helper

- And added unit test

Fixes #81