Removed Enum.IsDefined() usages since they were slowing code down (thanks to Ivo Tops for pointing this out)