some more cleanings and tweaks

and removed some old  functions which are not used anymore