Cleanup

Matched changes to old code