cleanup, minor refactoring