This removed code is also present in the ``enableLogging()`` method. Does it need refactoring there as well?