Further refactoring of proxy code