simplify keychain logic