More code restructuring