refactored the way the array type is implemented