move template in js to make it works with sf