Improve logging order