improve type checking and refactor Array info generation