refactored getRecordData