refactor mapping