Refactor code to remove the variable `m`