remove old code
misc fixes