Refactored renderer with a rendor method.