groovyfied the code