replace MagicFlag enum with a struct