Dependency injection for edit mode