Replace duplicated type / value mapping

Replace two case statements with a hash.