remove/fix old code