cleanup and more parsing