better parsing of enums