refactor gaurentee & add template options