Siginificant cleanup. Lot's of changes