groovy optimizations