Update library to portable and async refactoring
Code refactoring