refactor proxy