Replace ArrayList to array to save memory space.