\noindent{}In this chapter, we develop a new architecture for \gls{rewriting} \minizinc{} into \glspl{slv-mod}. We describe a new \textbf{systematic view of the execution of \minizinc{}} and build on this to propose a new tool chain. We show how this tool chain allows us to: \begin{itemize} \item efficiently rewrite \cmodels{} with \textbf{minimal overhead}, \item easily integrate a range of \textbf{optimization and simplification} techniques, \item and effectively \textbf{detect and eliminate dead code} introduced by functional definitions. \end{itemize} \noindent{}In addition to providing the first formalization and systematic description of rewriting MiniZinc, we will see that the resulting architecture is also significantly more efficient and flexible than the current \minizinc{} system. This chapter is organized as follows. \Cref{sec:rew-arch} provides a quick overview of the proposed architecture. \Cref{sec:rew-micronano} introduces the core of our \gls{rewriting} system using the \microzinc{} and \nanozinc{} languages. These new languages provide a new intermediate representation that enables more efficient \gls{rewriting}. \Cref{sec:rew-simplification} describes how we can perform various processing and simplification steps on this representation Finally, in \cref{sec:rew-experiments} we report on the experimental results of the prototype implementation.