Was all this copy past necessary ? 
If we need it twice you might want to play with jinja "include()"