basic arrays refactoring