Factored tempaltes out a bit and added build to the deploy.