template method pattern example