Refactoring the demo page