cleanups, refactoring