Refactoring a bit of the mapping stuff, minor savings