Clean up Value Mapping code a bit