strategy pattern coding. There are any references about strategy pattern coding in here. you can look below.