How can I avoid these nested repetitive ifs?Unkown = 0 is a good practise. If you instantiate enumeration, by default, it will always has value of 0. If you match value zero with some valid state, you might end up reading the wrong flag.