1) I'm not sure what the s/self.class/klass/ gives you (I don't think it's cleaner code, it fairly equivalent IMHO). But I don't feel strongly about it
2) key is not some key, it's a field. if there is some variable rename to go, I'd go for f -> field