Refactoring extension code to preserve URL and principal
Merge pull request #991 from yurydelendik/embedding-2

Refactoring extension code to preserve URL and principal