Refactored setupDragAndDrop