refactor crud view