Simplified function in helper.js