Nit: I would inline `rect` here