Checked with CodeChecker(following moodle coding conventions)