more effecient way of adding flags via the template