refactured renderer