Cleaned up the keychain/preferences switching