separated out some rendering utilities