refactor panel headers to use flag abstraction