clean up dir structur and set main working dir on toplevel