refactored renderer