Refactored + fixed dragging issue