support for RNG; moved generic functionality to boilerplate