simplify do_new

rip off some code and put it in a function