Refactor codes using Linq and Xml to address code review. Use ExtensionManager to handle major tasks including check/add/remove extension and role in configuration, and delete/install hosted extensions.