Restructured templates + events + app_init in separate files