Refactoring in demo1