fixed CodeNarc violations
converted to Groovy