refactored renderer factory to take object.