optimizing flag response