replace Array and add Dict to speed type-checking