Code cleanup with Peter Verhas
Incomplete - doesn't compile