Only render class attributes if needed.