code cleanup from codenarc and general code reduction effort