The logic to derive `title` is a bit harder to read than it needs to be. I'd be tempted to start with `title = ''` and then just have a conditional block for each of the three cases which assign from `_title()`.