lots of formatting, refactored out Type.fromArraySpec()