code cleanup and draggability improvements