rewriting KeySelector