optimize table and header Template