Optimized string typing into proper enum.