Splitting into controller and view.