Light refactor of TypedArray creation.