                 var newIndex: Int
                 
                 if locationInCell.x < (dropCell.bounds.width / 2) {
-                    newIndex = layout.indexToMoveSourceIndexLeftOfDestIndex(dragIndex, destIndex: dropIndex)
+                    newIndex = layout.indexToMoveSourceIndexLeftOfDestIndex(dragIndex!, destIndex: dropIndex)
                 } else {
-                    newIndex = layout.indexToMoveSourceIndexRightOfDestIndex(dragIndex, destIndex: dropIndex)
+                    newIndex = layout.indexToMoveSourceIndexRightOfDestIndex(dragIndex!, destIndex: dropIndex)
                 }
                 
-                currentDragState?.itemViewModel.listViewModel!.moveItemAtIndex(dragIndex, toIndex: newIndex)
+                draggingItemViewModel!.listViewModel!.moveItemAtIndex(dragIndex!, toIndex: newIndex)
                 
                 if let newCell = collectionView.cellForItemAtIndexPath(NSIndexPath(forItem: newIndex, inSection: 0)) {
                     dragProxyReturnToRect = convertRect(newCell.frame, fromView: newCell.superview)

    let locationInCell: CGPoint
}

struct DragState {
    let itemViewModel:SwiftBoardItemViewModel
    
    // TODO: hopefully not needed after refactoring to drag operations
    func indexOfItemInList() -> Int {
        return itemViewModel.listViewModel!.indexOfItem(itemViewModel)!
    }
}

struct DropState {
    let index: Int
    let cell: SwiftBoardCell

            if openFolderCollectionView != nil {
                if let folderViewModel = openFolderCollectionView!.listViewModel as? FolderViewModel {
                    // "Promote to root"
                    if let appViewModel = draggingItemViewModel as? AppViewModel {
                        rootViewModel?.closeFolder(folderViewModel)
                        rootViewModel?.moveAppFromFolder(appViewModel, folderViewModel: folderViewModel)
                        
