refactoring on crud directive done