Removed some unused or bad code