Moving the middleware out
More test templating work.