Enhancement/refactoring array

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