Removed most unused code