Optimize the code
Merge pull request #316 from dreamsxin/gridfs

Optimize the code