Merge pull request #4093 from leoetlino/flags-and-events Use Common::Flag and Common::Event when possible