refactor proxying