Refactor the example