adding support for variable replacement