factor HTML header code from backend scripts