Refactored directive to use template URL