Adding a replace function for wrap-fn-in-defn