modified for function based data retrieval