code refactoring + proxy code