Added enum parsing instead of cast