refactor mapping for perf