Refactor proxy management