Improved sample and callback stuff