Extracted render method to allow custom renderers by subclassing