strategy design pattern.