Moved code back into single directive.