refactors renderer code into subclasses