moved header logic into BaseRoute