Refactor printing array

Signed-off-by: Bebe Peng <b.peng@awesometown.local>