Remove old code
Massive code dump (sorry)