refactor to a more general convertFromRenderer function