Refactor demo and update doc