v template controller method refactord