little bit of rewriting