add optimize option and prepare file system