Move drag and drop code to own file