programatically reduce/expand header