improve enum parsing