logger and cleanup