model: cache types in a hashmap instead of in a list