Added `getState` method to factory