Move string substitution up