refactory of put template