nit: could we `opts && opts.focus` instead of the line before?