refactor to use expectation