Tweak storage and retrieval of keys