This is a bit cleaner and avoids borrow checking problems.

Differential Revision: https://phabricator.services.mozilla.com/D11271