Move groovy code to external script