Refactor assertions to better follow convention and make more flexible