demo refactoring