Refactoring and header adjustments