reorganise key management