applied Template method pattern