Removed anonymous functions from directives