switched implementation to use contextual flag