small fixes
More strict keychain validation and general code refactoring for user model