refactored to expose helper functions and fixes #1
builtin and helpers added