refactored array structure