You reference `document.activeElement` three times, so might as well assign that here as `activeElement` and use that.