improve Database.insert