refactoring, and add demo3.html