optimized groovy