restructured
view func