use template method