refactored a few routes/index.js functions into helpers/index.js