DRY-up code - move fetch remote data to utility function