Replaced parsing enums with built-in method.