cleanup templates controller