template Method pattern design