Refactor

Refactoring of global header code