refactor JS variables