refactoring CRUD