I have the following code, it takes a list of maps representing bands and transforms the band properties via the pipeline_each method. As you can see in the code, I am dealing with a lot of Options being returned when I modify the band data in the map - I am using an immutable map object and therefore need to return a new map each time the function is called.I am also not happy about the type of the bands data structure being a List[Map[String, Any]] - particularly the Any part because I need to convert the values I get out of the maps to String types in order to modify them. I am stuck with this data structure though.How can I make this code better, specifically addressing my concerns above?    object Exercise {  val bands: List[Map[String, Any]] = List(Map(name -> sunset rubdown, country -> UK, active -> true),  Map(name -> women, country -> Germany, active -> false),  Map(name -> a silver mt. zion, country -> Spain, active -> true))  def set_canada_as_country(band: Map[String, Any]): Map[String, Any] = {    Map(name -> band.get(name).get, country -> Canada, active -> band.get(active).get )  }  def strip_punctuation_from_name(band: Map[String, Any]): Map[String, Any] = {    Map(name -> band.get(name).get.toString.replace(., ), country -> band.get(country).get, active -> band.get(active).get )    //toString above is kinda gross and could cause a class cast exception    //do I have to handle all the case matching on some/none for all the above calls to get?  }  def capitalize_names(band: Map[String, Any]): Map[String, Any] = {    Map(name -> band.get(name).get.toString.toUpperCase, country -> band.get(country).get, active -> band.get(active).get )    //same again - don't like the toString  }  def pipeline_each(data: List[Map[String, Any]], fnList: List[Map[String, Any] => Map[String, Any]]): List[Map[String, Any]] = {    fnList.foldLeft(data) {(bandList, currFn) => bandList.map(currFn)}  }}I execute the above code via the REPL like so:Exercise.pipeline_each(Exercise.bands,  List(    Exercise.set_canada_as_country,    Exercise.strip_punctuation_from_name,    Exercise.capitalize_names))
Transforming a list of maps representing bands
scala