self generated wrapping code