refactor to get rid of MappingWrapper, rename a few miscellaneous variables