modify template method pattern