nit: put `None` case on a separate line.