refactoring mapping work into DataMapper.set_mapping()