refactor remote proxy