This "opening of file and getting the data" could be moved to an anonymous function since it is out of context here.