refactor drag and drop code