add encrypting, refactoring, optimizing log upload