Cleaned up proxy code