Another round of refactoring of the proxy functionality