Enhancement/refactoring array

Bug fix: No
Feature addition: No
Backwards compatibility break: No
Unit test passes: ?
Phpspec specification passes: Yes
Checkstyle issues: No
ChangeLog updated: No
Fixes the following issue: