splitting up info_for_db function into two