Some improvements on the persistence

Refactored for loop
Tests are now independent of their order