replace the original element with one returned from callbacks.