cleaned up Groovy a bit