clean up code in header.ts