- improve Scala-style (strip procedure syntax, use map/flatMap of Option)
- upgrade libraries