Broke out db stuff into a new file