Use Set API instead of enum arithmetics