Big refactoring of ExtensionItem and custom handlers