Refactor to solution using Strategy and Factory patterns