refactor adding of header