Added the common extension for wr directives. A lot of clean up also.