Extracted seed generation to separate function.