refactored and update the header function argument