Only call the replacer if it's a function