refactored asserts