refactoring for a more sane drag-and-drop implementation