refactoring amd-component directive