Refactor assertions