Clean-up and expansion of key management