Factored out pure code into Sneaky module.