Refactor replace_vars: clarified documentation for variable replacement registration