Implement keychain
Fix identation
Fix identation and memro leak