Refactorization of the code generation of the tabs