remove template after generating