Removed Ref class and converted all usages to Key.