Improving key string construction