document outputHeader method
simplify generation example
extract method