Refactoring some assertions