Add more idiomatic version of groovy code.