code refactoring to remove redundancy, fixed bugs in no results for list, fixed bug in clear (issue #30)
Merge pull request #31 from arolan/bug_fix/issue_30

code refactoring to remove redundancy, fixed bugs in no results for list...