Removed a lot of leftover dead code