Refactoring: no more array usage