refactored  update and  delete methods

Signed-off-by: Gerard Cote <grcote@gmail.com>