Refactored to allow for an optional updateTransform callback.