adapting for groovy