Extract the factory from Statement.