refactoring some header code