Converted conversion to Groovy