modify code style and add log info