Mostly structural changes. Removed unused stuff
Fixed typo.