Continued tidy-up of the code according to CodeNarc suggestions