added management of code and diagram tabs