Replaced enum with foreach