pass replacements along
generalised output