rework templates and controllers