Several optimizations and adding proxying feature