add template method pattern