Refactor the GenericTab class to reduce duplicate code