fix code consistency issues with ID vs _id
refactor tab operations into TabController object