Functions WS 10 - code cleanup