start rewriting to directives