Refactoring method count
Add new methods for query and deletion