Data Mapper config generation code refactoring and function building