Improved code quality and improved logging.