Refactored js-vars action