header consolidation, minor refactoring