refactor: isolate function for resource retriving from internet