Adding logging for repeatability and organize imports.