Factored out the helper functions from get into helpers.js.