removed unused stuff
removed some duplication