Some refactorings of the groovy solutions