Some renderer refactoring