Rewrite drag-and-drop system using generics