Refactoring database code
Merge branch 'master' of https://github.com/billliu1992/cs411project