edited with remarks by Sergiy/best practise to write controllers