Groovy refactor