Massive code overhaul, more to go.