createState o (Just s) Nothing = do
  ident <- getIdentity s
  case ident of
    Nothing -> return Nothing
    Just i -> createState o (Just s) (Just i)
createState o (Just s) Nothing = do
  ident <- getIdentity s
  case ident of
    Nothing -> return Nothing
    Just i -> createState o (Just s) (Just i)
createState o (Just s) Nothing = do
  ident <- getIdentity s
  case ident of
    Nothing -> return Nothing
    Just i -> createState o (Just s) (Just i)