Code overhaul