Code cleanup according to moodle codechecker