added QueryBuilder for query and refactored some signatures of finding
and function invoking and fix some bugs.