factorize headers