M Refactoring assert functions