update
refactored db to refrain from manipulating collections using array indexes