[untested] Basic foam refactoring complete