Code style suggestion: instead of matching on a boolean, just change this to
```
if (implicitPrefs) {
   // stuff
 } else {
  None
 }
```
Scala's `if` is an expression and will return the last value from each branch.