fixing directive output and renaming functions