Removed lots of useless code