Add saveState, some logging cleanup