Housekeeping. Remove a load of confusing old code that must have been there for ages!