few code fixes
drop some unused code