refactored tests to use utility methods and custom matchers as per exercise 2 in chpt 8