Added wrapper, some refactoring in mapper