I think there's a lot of `Option` stuff happening inside the `case None` bit. The nesting's pretty hard for me to follow. Is it possible to flatten it all out by using a for comprehension?