Further tweaking to DB inserts