refactoring the basic CRUD operations