Some cleanup, minor refactoring, changes.