Small code optimization, Code cleanup according to moodle codechecker