separated db functions

separated db functions into a diff files