Move object mapping to cpp file