refactored mapping script and added utility method for name mangling