logic created for ref's data creating;