moved db javascript to its own file