refactoring draggable