integrating template retriever phase one