Add comment and use better string conversion for enum valueOf call