fix structure and remove temp files