restructured function conversion