split data loading to separate method