make custom rendering more generic