I see here some logic that's duplicated. Perhaps we can have a more general mechanism? E.g. implement a marker interface, and have this logic in another class, active IF the renderer implements the interface?