Updated and improved logging