Refactor keychain code and add access group

:hamburger: