Refactor updating method of key associations