optimize drawHeader