DRY refactoring for CRUD