Optimized some of the functions in helpers.js
Merge pull request #3427 from pjackson28/cleanuphelpers

Optimized some of the functions in helpers.js