Improve logging system