Move mapping code to shared project