remove dead code from directive