Refactor the demo