Implementing Template method pattern