some rewriting...