abstracted out tab functionality into method