Update to groovy controller; cleaned up and made groovier