cleanup proxy code