Client side drop handling moved into a function