removed some unless stuff.
refactored some stuff.