Simplify handling of flags.