refactor groovy dsl