Refactor Bob with tests