outsourced snapping and snappingContext to static.