major refactoring: renaming files, splitting long functions, fixing memory-leak
adding a random-random test file