Added database backing and moved it to it's own file