rewrite view callback function index to use template