Refactoring: using gen.Task for blocking functions and Process multiprocessing