rewrite the wrapper completely