Refactor demo2 structure