working tree maker with some cleanup