refined the logging