Move parsing of array declaration into a function