Rewrite sampler to use Elisp hash-tables.