add Array and refactor