refactored and tested assertions