Modifications for searching secrets based on folders + error handling + some refactorings