Random data inputs, refactoring