demos refactoring