get data method generalized