adjusted text or range-based version to in-place code