Shares script code among modes.
Fixes a pattern of escaping.