Insert-into-DB functions polished