removed some unneeded code.
fixed some deprecreated stuff