some cleanup and python