switch instead of hashmap