refactor and add proxy demo.