some cleanup and thinking