refactor of set proxy