Refactoring and a bug fix in RenderDriver.hpp