Fixed code to addapt to codenarc rules