Refactored to be more groovy