Try and improve login time by batching db transactions