In current implementation the key type should be `Ord + Copy`, but it's too strict. Would be better to have `PartialOrd + Clone`. Need to check the trade offs for that approach.