add proxy and made some refactoring