change template into js