Replace FactoryError with ContextError