add function to save log info and folder refactoring