Merged @vasily-kirichenko's proxy work, with couple of changes