Clean up redundant code in drag and drop