Little refactoring. Added test class for arrays