"val" in for expression is deprecated, remove it to avoid warning in more recent version of Scala