Part 3 of major code rebuild