refactoring and headers