The Strategy and Factory Pattern