Add middleware
Remove templating from data
Introduce generators