Use std::map to optimize lookup performance