more demo refactoring