refactors tabpanel events