Refactored with groovy transformations