redesigned api for rendering via typeclass