rewrite with lots of improves