Small refactorings
Refactored key file storing into the document.
Updated documentation
small refactorings on the key file settings