more general template and controller