revision the autorization
Refactoring multithreading