Use factory to create extension objects
Add factory for extensions