Working with template and controllers