Asserion refactoring +tests