Refactor assert methods