switching to groovy and fixing some issues