More of the same
More work, move db and refresh code to shared