restructured functions