mescc: Refactor ret.