Cleaned up a load of useless code