Fix log format
Improve coding style