Explain use of references inside templates