add use database and some minor housekeeping
Merge pull request #2 from cherrysoft/housekeeping

add use database and some minor housekeeping