Make it simpler using just map and dict.