Use JS variables instead of replacement