add desgin pattern: template method