Didn't quite manage to remove everything to do with references.