Progress on db layer