Refactoring Arrays and KsaRandom