Refactor query function
Merge pull request #2 from NgoHuy/master

Refactor query function