Removed a lot of no-longer-necessary code