Refactored stubrandomiser