Refactored the code to add comments into a directive