templates controller and some view stuff