Code restructured