Revmove some old code and fix ups