Move everything to engine and wrap it up in the closure.