refactored header to use some logic from header.tpl in /simpleDemo