demo refactor