refactor: using generic methods to perform CRUD