Refactor mapper context