group similar header together