Removed a lot of obsolete code