Refactoring
Random generator fix
Random generator fix