cleanups; refactoring