template method source code