Fix duplicate code in header