mimicking the 'replacements' option handling