simplify  by saving reference to style tag instead of saving index